{% load adminmedia filermedia filer_admin_tags %}
{% load i18n %}
<div class="pull-right">
    
    <form id="changelist-search" action="." method="get" class=" form-inline navbar-search">
        {% csrf_token %}
        <div>
            <input type="text" size="40" name="q" value="{{ search_string }}" id="searchbar" title="{% trans "Enter your search phrase here" %}" class="search-query" placeholder="Search" />

            <label class="checkbox">
                <input type="checkbox" id="limit_search_to_folder" name="limit_search_to_folder" {% if limit_search_to_folder %}checked="checked"{% endif %} title="{% trans "Check it to" %} {% trans "limit the search to current folder" %}"/>
                {% trans "search the current folder" %}
            </label>

            {% if show_result_count %}
            <small>({% trans "found" %} {% blocktrans count folder_children|length as counter %}1 folder{% plural %}{{ counter }} folders{% endblocktrans %} {% trans "and" %}
            {% blocktrans count folder_files|length as counter %}1 file{% plural %}{{ counter }} files{% endblocktrans %}) <a href="?{% if is_popup %}_popup=1{% if select_folder %}&select_folder=1{% endif %}{% endif %}">{% trans "cancel search" %}</a></small>
            {% endif %}

            {% if is_popup %}
                <input type="hidden" name="_popup" value="1" />
                {% if select_folder %}<input type="hidden" name="select_folder" value="1" />{% endif %}
            {% endif %}            
        </div>
    </form>
</div>
<script type="text/javascript">document.getElementById("searchbar").focus();</script>
